<%--
    fileName      : /noticeoption/ctpnoticeop.jsp
    author        : user
    createDate    : 2016-12-20  
    lastModifier  : user
    lastModifyDate: 2016-12-20       
    description   : 列表页面
--%>
<%@ page language='java' contentType='text/html; charset=UTF-8' pageEncoding='UTF-8' %>
<%@ taglib uri='ctp-tag' prefix='ctp' %>
<%@ page import="com.icbc.cte.base.CTEConstance"%>
<%
	String file_visit_path = "";
	String file_save_path = "";
	try {
		file_visit_path = CTEConstance
				.getEnvProperty("file_httpsave_path");
		file_save_path = CTEConstance.getEnvProperty("gonggao_file_save_path");
	} catch (Exception e) {
		file_visit_path = "";
		file_save_path = "";
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
        <title></title>

        <ctp:include items='public,ajaxfileupload,grid,validator,borderlayout,panel,form,button,groupbox,gridlayout,label,textfield,combobox,link,checkboxgroup,checkbox,textarea,datepicker,checkbox,chain,message_ex,ajaxtree,rte,toolbar'/>

        <script type='text/javascript' kind='variant'>

            var borderlayout1;
            var queryPanel;
            var queryForm;
            var queryGroupbox;    //问题信息
            var queryGridlayout;     
            var title; //公告列表标题
            var time;	//发布时间
            var noticeId; //所属模块
            var type; //公告类别:营销公告(1进度播报2营销竞赛3产品培训)客服公告(1清算日报2数据周报3其他通知)
            var content; //公告内容 
			var fileurl;//附件地址 
			
            var headerAnn;
            var proToolbarAnn;
            var dataGridAnn;
            var flagisup='';
            
            var optype;
            var asktype;
            var validator5;
            var goBack;		      //返回
            var submit;		      //提交
            var reset;	     	  //重置
            var modify;
            var modifyURL='';
            var flag;			  //新增修改标识
            var v_ctpnoticeopId = "";
        </script>
        <script type='text/javascript' kind='event'>
	        /*
	         * @method initData
	         * @desc  初始化数据
	         * @author user
	         */
			function initData(){
				setReadOnly(false);
				if(flag == 0){//新增
					//queryForm.getObj("fileurl").setReadOnly(true);
					$("#label5").hide();
                	queryForm.getObj("asktype").hide();
                	$("#label4").hide();
                	queryForm.getObj("optype").hide();
                	$("#label7").hide();
                	queryForm.getObj("url").hide();
					queryPanel.setTitle('<ctp:label key="add"/>');
				}else if(flag == 1){//修改
					//queryForm.getObj("fileurl").setReadOnly(true);
					modifyURL = '<ctp:url href="ctpnoticeoptionmain.flowc" flowActionName="queryctpnoticeopdetail"/>';
					queryPanel.setTitle('<ctp:label key="modify"/>');
					   ctp.data.getJSONA({
							url:modifyURL,
							reqData:{"language":"zh_CN","id":v_ctpnoticeopId},
							success:function(data){
								modifyData = data;
								v_ctpnoticeopId = modifyData.id;
								if(modifyData && modifyData.retCode == "0"){
									setValue('0');
								}
							}
					});
				}else{  //查看
					queryForm.getObj("submit").hide();
					queryForm.getObj("reset").hide();
					setReadOnly(true);
					queryPanel.setTitle('<ctp:label key="view"/>');
				}
			}

			/*
	         * @method setReadOnly
	         * @desc  设置表单内容是否readonly
	         * @author user
	         */
			function setReadOnly(isReadOnly){
			    queryForm.getObj("title").setReadOnly(isReadOnly);
			    queryForm.getObj("noticeId").setReadOnly(isReadOnly);
			   // queryForm.getObj("type").setReadOnly(isReadOnly);
			    queryForm.getObj("time").setReadOnly(isReadOnly);
			    //queryForm.getObj("content").setReadOnly(isReadOnly);
			}

			/*
	         * @method formSucc
	         * @desc  表单提交成功回调函数--提示成功返回列表页面。
	         * @author user
	         */
			function formSucc(data){
				  var _message;  
				  if(flag=="0"){ 
					_message='<ctp:label key="add"/>';//新增
				  }else if(flag=="1") {
					_message='<ctp:label key="modify"/>';//修改
				  }  

				  if(data[0].retCode=="0"){//提交成功
					  var mailTo = '';
					  var smtpcontent = '';
					  var subject = '';
					  if(flagisup =='file'){
						  v_ctpnoticeopId=data[0].optionId;
	                	  //sealrecordForm.setHiddenValue("oaapplyrecordbasicRecId",v_ret_recId);
						  flag = '1';
						  flagisup="";
						  return;
					}
					  if(flag == '0'){
						  ctpMSB.confirm({
							  title: '<ctp:label key="tips_msg"/>',
							  message: _message+'<ctp:label key="success_continue_add"/>',
							  cancelTxt: '<ctp:label key="back2list"/>',
							  handler: function(tp){
								  if(tp == 'ok'){
									  window.location.href="<ctp:url href='ctpnoticeoptionmain.flowc' flowActionName='ctpnoticeopdetail'/>&flag=0";
								  }else{
									   history.go(-1);
								  }
						      }
						  });
					  }else if(flag == '1'){
	                   ctpMSB.succeed({
	                       title:'<ctp:label key="tips_msg"/>',
	                       closeBtn:true,
	                       message:_message+'<ctp:label key="success"/>',
	                       handler:function(){
								try{
									top.ctpTAB.delTab(top.ctpTAB.getCurrentTabPos());
								}catch(e){
									
								}
						   }
	                       });//操作成功！
					  }
	                 }else{
	              		 var msgErr='<ctp:label key="error_code"/>'+data[0].errorCode+'<ctp:label key="error_msg"/>'+data[0].errorMsg;              
	                     ctpMSB.error({
	                        title:'<ctp:label key="error"/>',
	                        message:_message+''+ msgErr
	                     });//操作失败！
	                }                     
			}

			 /*
	         * @method sealrecordFormSucc
	         * @desc 提交信息
	         * @author lenovo
	         */
	        function queryFormSucc(data){
	            var _fnContext = "sealrecorddetail.jsp -> sealrecordFormSucc(data);";
	            try {
	                var _message ;
	                if(flag =='add'){
	                	_message = '<ctp:label key="toolbar.new"/>';
	                }else if(flag == 'modify'){
	                	_message = '<ctp:label key="toolbar.modify"/>';
	                }
	                if(flagisup =='1'&&data.retCode=="0"){
	                	  v_ctpnoticeopId=data.optionId;
	                	  sealrecordForm.setHiddenValue("oaapplyrecordbasicRecId",v_ret_recId);
						  flag = 'modify';
						  flagisup="0";
						  return;
					}
					if(submitflag=='submit'&&data.retCode=="0"){
						v_ret_recId=data.recID;
						applyApprove();
						return;
					}
	                if(data.retCode=="0"){//提交成功
	                    ctpMSB.succeed({
	                        title:'<ctp:label key="result_notice"/>',
	                        message:_message+'<ctp:label key="success"/>',
	                        handler: function(tp){
	                        	if(submitflag=='submit'){
									  parent.ctpMSB.close();
		                        	  window.close();
								}else{//保存后 在修改其他信息
									v_ret_recId = data.recID;
									sealrecordForm.setHiddenValue("oaapplyrecordbasicRecId",v_ret_recId);
									flag = 'modify';
									flagisup="0";
								}
	                        }
	                    });
	                }else{
	                    var msgErr=',<ctp:label key="errorCode"/>:'+data.errorCode+',<ctp:label key="errorMsg"/>:'+data.errorMsg;
	                    ctpMSB.error({title:'<ctp:label key="result_notice"/>',message:_message+'<ctp:label key="error"/>'+msgErr});//失败！
	                }
	             }catch(e){
	                ctp.core.log.err(_fnContext, e.message);
	            }
	         }

			
			/*
	         * @method submitForm
	         * @desc  提交表单
	         * @author user
	         */
			function submitForm(){
				 var _mContext = "prodetail.jsp -> queryFormSubmit()";
				 var noticeId=document.getElementById("noticeId").value;
				 var title=document.getElementById("title").value;
				 if(title==''){
					 alert("标题不能为空!");
					return; 
				}	
				if(noticeId==''){
					alert("请选择所属模块!");
					return;
				}	
				 
				 var type=document.getElementById("type").value;
				 if(type==''){
					alert("请选择公告类型!");
					return;
				}
	        	 try {
	            	 if(flag == 0){
	    		        queryForm.setHiddenValue("flowActionName","addctpnoticeop");
	               	 }else if(flag == 1){
	               		queryForm.setHiddenValue("flowActionName","editctpnoticeop");
	                 }
	               		queryForm.submit();
	        	 }
	        	 catch (e) {
	                 ctp.core.log.err(_mContext, e.message);
	             }
			}
			/*
	         * @method resetForm
	         * @desc  重置表单
	         * @author user
	         */
			function resetForm(){
				ctp.util.closeAllPrompt();//关掉页面上所有验证框架产生的提示框
				if(flag == 0){//新增
					queryForm.reset();
				}else if(flag == 1){//修改
					setValue('1');
				}
			}

			/*
	         * @method setValue
	         * @desc  设置页面值
	         * @author user
	         */
			function setValue(isReset){
			
                if(isReset == '1'){
					queryForm.reset();
				}
                queryForm.getObj("title").setValue(modifyData.title);
                document.getElementById("filename").value=modifyData.filename;
                //queryForm.getObj("fileurl").setValue(modifyData.fileurl);
                queryForm.getObj("noticeId").setValue(modifyData.noticeId);
                if(modifyData.noticeId=='1'){
                	queryForm.getObj("optype").setValue(modifyData.type);
                	//queryForm.getObj("asktype").setReadOnly(true);
                	queryForm.getObj("optype").setReadOnly(false);	
                	//queryForm.getObj("label4").setDisable(false);
                	//queryForm.getObj("label5").setDisable(true);	
                	$("#label5").hide();
                	queryForm.getObj("asktype").hide();
                }else{
                	queryForm.getObj("asktype").setValue(modifyData.type);
                	queryForm.getObj("asktype").setReadOnly(false);
                	queryForm.getObj("optype").setReadOnly(true);	
                	$("#label4").hide();
                	queryForm.getObj("optype").hide();	
                }
                document.getElementById("type").value=modifyData.type;
                //queryForm.getObj("type").setValue(modifyData.type);
                queryForm.getObj("time").setValue(modifyData.time);
                queryForm.getObj("content").setValue(modifyData.content);
                
                queryForm.getObj("optiontype").setValue(modifyData.optiontype);
                if(modifyData.optiontype=='0'){
                	$("#label7").hide();
                	queryForm.getObj("url").hide();
                	$("#label9").show();
                	queryForm.getObj("content").show();
                }else{
                	$("#label9").hide();
                	queryForm.getObj("content").hide();	
                	$("#label7").show();
                	queryForm.getObj("url").show();	
                }
                
			}
			/*
	         * @method goBack
	         * @desc 点击返回按钮
	         * @author user
	         */
			function goBack(){
				history.go(-1);
			}

			function changeNotice(){
				var noticeId=document.getElementById("noticeId").value;
				if(noticeId=='1'){
					$("#label5").hide();
                	queryForm.getObj("asktype").hide();
                	$("#label4").show();
                	queryForm.getObj("optype").show();
				}else if(noticeId=='2'){
					$("#label4").hide();
                	queryForm.getObj("optype").hide();	
                	$("#label5").show();
                	queryForm.getObj("asktype").show();
				}else{
					$("#label5").hide();
                	queryForm.getObj("asktype").hide();
                	$("#label4").hide();
                	queryForm.getObj("optype").hide();
				}
			}

			function changeType(){
				var noticeId=document.getElementById("noticeId").value;
				if(noticeId=='1'){
					document.getElementById("type").value=document.getElementById("optype").value;
				}else if(noticeId=='2'){
					document.getElementById("type").value=document.getElementById("asktype").value;
				}else{
					document.getElementById("type").value="";
				}
			}

			function changeOptionType(){
				var optionType=document.getElementById("optiontype").value;
				if(optionType=='0'){
					$("#label7").hide();
                	queryForm.getObj("url").hide();
                	$("#label9").show();
                	queryForm.getObj("content").show();
				}else if(optionType=='1'){
					$("#label9").hide();
                	queryForm.getObj("content").hide();	
                	$("#label7").show();
                	queryForm.getObj("url").show();
				}
			}

			function validatex(){
				for(var i=0,n=validateArray.length;i<n;i++){
					if(!validateArray[i]){
						continue;
					}
					if(!(formValidator.validateObjs(validateArray[i]))){
						try{
							validateArray[i].focus();
						}catch(err){
							jQuery("#_ctp_panel_content_queryPanel")[0].scrollTop=0;
							jQuery("#"+validateArray[i].getDomId()).focus();
						}
						return formValidator.validateObjs(validateArray[i]);
					}
				}
				return true;
			}

			function handler_loadGridAnn(){//上传 删除后更新附件列表
				data_list_urlAnn = '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ctpnoticeopId+'&indexId='+encodeURI(noticeId.getValue())+'&labelId=noticeoption&businessType=0';
			   	dataGridAnn.loadData(data_list_urlAnn);
		   	}
		   	function downloadFiles(){//文件下载功能
				downloadForm.openType.value = "attachment";
				downloadForm.fileName.value = this.filePath;
				downloadForm.showFileName.value = this.fileName;
				downloadForm.submit();
		    }

		   
	        
	        function sealrecordNewFormSubmit(){
	        	//alert(ifneedReturn.getValue()+"------"+returndate.getValue());
	            var _fnContext = "sealrecorddetail.jsp -> sealrecordNewFormSubmit();";
	            submitflag ="submit";
            	try {
	            	if(flag == 'add'){
	            		sealrecordForm.setHiddenValue("flowActionName","addsealrecord");
	               	 }else if(flag == 'modify'){
	               		sealrecordForm.setHiddenValue("oasealrecordSealId",'<ctp:out name="oasealrecordSealId"/>');
	            		sealrecordForm.setHiddenValue("oaapplyrecordbasicRecId",v_ret_recId);
	            		sealrecordForm.setHiddenValue("flowActionName","editsealrecord");
	                 }
	                 sealrecordForm.submit();
	                }catch(e){
	                    ctp.core.log.err(_fnContext, e.message);
	               }
	        }
						
        </script>
		<script type='text/javascript' kind='notUI'>
			var formValidator = new ctp.validator({id:"formValidator"
        	});//验证框架
		</script>
        <script type='text/javascript' kind='ui'>

            $(window).load(function(){
            	v_ctpnoticeopId = '<ctp:out name="id"/>';
            	flag = '<ctp:out name="flag"/>';
   		     //================================UI变量定义片段============================================================
                

					
						title = new ctp.ui.textfield ({//公告列表标题
							id : 'title' ,
							//beanName:'ctpnoticeop',
							width:'720px',
							type : 'text'
						});	

						time = new ctp.ui.datepicker({ //公告发布时间
							id : 'time',
							//beanName:'ctpnoticeop',
							width:'236px',
							isInput : true,
							showTime :true
						});			
								
						noticeId = new ctp.ui.combobox ({//类别 1 营销公告2 客服公告
							id : 'noticeId' ,
							//beanName:'ctpnoticeop',
							width:'236px',
							defaultItems:[{
						     	text:'---请选择---',
						     	value:'',
						     	selected:'true'
					     	}],
							items:[
								{text:'营销公告',value:'1',title:'营销公告'},
								{text:'客服公告',value:'2',title:'客服公告'}
							],
							onChange:changeNotice
						});	
					
						
						optype = new ctp.ui.combobox ({//类别 1 营销公告2 客服公告
								id : 'optype' ,
								//beanName:'ctpnoticeop',
								width:'236px',
								defaultItems:[{
							     	text:'---请选择---',
							     	value:'',
							     	selected:'true'
						     	}],
								items:[
									{text:'进度播报',value:'1',title:'进度播报'},
									{text:'营销竞赛',value:'2',title:'营销竞赛'},
									{text:'产品培训',value:'3',title:'产品培训'}
								],
								onChange:changeType
							});	

							

						asktype = new ctp.ui.combobox ({//类别 1 营销公告2 客服公告
							id : 'asktype' ,
							//beanName:'ctpnoticeop',
							width:'236px',
							defaultItems:[{
						     	text:'---请选择---',
						     	value:'',
						     	selected:'true'
					     	}],
							items:[
								{text:'清算日报',value:'1',title:'清算日报'},
								{text:'数据周报',value:'2',title:'数据周报'},
								{text:'其他通知',value:'3',title:'其他通知'}
							],
							onChange:changeType
						});	
						
						
						/*type = new ctp.ui.textfield ({//公告类别:营销公告(1进度播报2营销竞赛3产品培训)客服公告(1清算日报2数据周报3其他通知)
							id : 'type' ,
							beanName:'ctpnoticeop',
							width:'236px',
							type : 'text'
						});*/		
						optiontype = new ctp.ui.combobox ({//类别 0 手动编辑1 外链接
							id : 'optiontype' ,
							//beanName:'ctpnoticeop',
							width:'236px',
							defaultItems:[{
						     	text:'手动编辑',
						     	value:'0',
						     	selected:'true'
					     	}],
							items:[
								{text:'外链接',value:'1',title:'外链接'}
							],
							onChange:changeOptionType
						});
						url = new ctp.ui.textfield ({//公告列表标题
							id : 'url' ,
							//beanName:'ctpnoticeop',
							width:'720px',
							type : 'text'
						});	
						/*
						fileurl = new ctp.ui.textfield ({//公告列表标题
							id : 'fileurl' ,
							//beanName:'ctpnoticeop',
							width:'720px',
							type : 'text'
						});	*/
						  
						
						content = new ctp.ui.rte ({//公告内容
							id : 'content' ,
							//beanName:'ctpnoticeop',
							//renderTo:ctpweb,
							width:'720px'
						});	

						
						 //----公告附件开始
		                headerAnn=new ctp.ui.grid.header({//附件列头
							title: [
								[{text: ""},
								{text: '文件链接',width:'300px'},//文件链接
								{text: '上传时间'},//上传时间
								{text: '上传人',css:{"text-align":"center"}},//上传人
						 		]
							],
						  	rowIdFieldName: "id",
						  	attr: [
									{colType: "radiobox"},
										{fieldName: "fileName",
											fieldType: 'link',//生成下载超链接，添加下载方法
						                    fieldAttr:{title:'下载附件',onClick: downloadFiles}},//'下载附件'
						                    {fieldName: "postDate"},
						                    {fieldName: "postUser",css:{"text-align":"center"}}
								]
						});
					   	proToolbarAnn = new ctp.ui.toolbar({//附件按钮
					       	id: 'proToolbarAnn',
					       	leftItems: [
					          	 {
					          	     type: 'button',
					          	     id: 'addButtonAnn',
					         	     text: '新增',//新增
					          	     icon: 'add',
					          	     onClick: function(){
						          	     var notice=noticeId.getValue();
						          	     if(notice==''){
							          	 	alert("请选择公告类别");  
							          	 	return;  
							          	 }
							          	 /*
							          	 var tmp='';
							          	 if(notice=='1'){
							          		tmp=document.getElementById("optype").value;
								         }else{
								        	 tmp=document.getElementById("asktype").value;
									     }
						          	   
						          	 
						          	     if(tmp==''){
							          	 	alert("请选择公告分项类别"); 
							          	 	return;   
							          	 }*/
					     				var relId ='';
						     				if(flag=='0'){
						     					flagisup = "file" ;
			 			     					queryForm.setHiddenValue("flowActionName","addctpnoticeop");
			 			     					queryForm.submit();	
							     			}
						     				if(flag=='0'){ //新增页面
			 			                   	    var srcPath = '<ctp:url href="fileuploadnew.flowc" flowActionName="addfile"/>&recId='+v_ctpnoticeopId+'&indexId='+encodeURI(noticeId.getValue())+'&labelId=noticeoption&businessType=0';//businessType 2 用户管理模块
			 			     		           	   ctpMSB.win({
						     				           message   :srcPath,
						     				           width     :600,
						     				           height    :450,
						     				           title     :'附件上传页面',//附件上传页面
						     				           maxBtn    :true,
						     				           minBtn    :true,
						     				           iframe    :true,
						     				           handler   :handler_loadGridAnn
						     			        });
		 			     		           	
					     				}else if(flag=="1") {//修改
					     					
					     					relId='<ctp:out name="id"/>';
		 			                   	    var srcPath = '<ctp:url href="fileuploadnew.flowc" flowActionName="addfile"/>&recId='+v_ctpnoticeopId+'&indexId='+encodeURI(noticeId.getValue())+'&labelId=noticeoption&businessType=0';//businessType 01 用鉴记录管理模块
					     		           	   ctpMSB.win({
					     				           message   :srcPath,
					     				           width     :600,
					     				           height    :450,
					     				           title     :'附件上传页面',//附件上传页面
					     				           maxBtn    :true,
					     				           minBtn    :true,
					     				           iframe    :true,
					     				           handler   :handler_loadGridAnn
					     			           });
					     			    } 
					             }
					           },'-',{
					               type: 'button',
					               id: 'delButtonAnn',
					               text: '删除',//'删除',
					               icon: 'delete',
					               onClick: function(){
					            	   if(dataGridAnn.getSelectedRowId().length==0){
					                  		ctpMSB.alert({message:'请先选择需要删除的数据'});//'请先选择需要删除的数据
					                  		return;
					              		}
					              		ctpMSB.confirm({
					          				message:'确定要删除么？',//'确定要删除么？',
					          				handler:function(tp){
					          					if(tp=="ok"){
					          						var _id=dataGridAnn.getSelectedRowId()[0];
					          						var _data=dataGridAnn.getSelectedData()[0];
					          						var fileUrl = _data.realpath;
					          						ctp.data.getJSONA({
					          							url:'<ctp:url href="fileuploadnew.flowc" />',
					          							reqData:{
					          								"flowActionName":"deleteindexfile",
					          								"id":_id,
					          								"userId":'<ctp:out name="sessCtx.user.id"/>',
					          								"fileUrl":fileUrl
					          							},
					          							success:function(data){
					          								if(data && data[0].retCode=="0"){
					          									ctpMSB.alert({message:'删除成功'});//'删除成功'
					          									//dataGridAnn.loadData(data_list_urlAnn);
					          									handler_loadGridAnn();
					          								}else{
					          									ctpMSB.alert({message:'删除失败'});//'删除失败'
					          								}
					          							}
					          						});
					          					}
					          					if(tp=="cancle"){
					          						return;
					          					}
					              			}
					              		});
					               }
					           }
					       ]
					   });
					   dataGridAnn = new ctp.ui.grid({//附件数据
				      		id: "dataGridAnn",
				      		height: '250px',
				      		width:'90%',
				      		title: '附件初稿',
				      		header: headerAnn,
				      		url: '<ctp:url href="fileuploadnew.flowc" flowActionName="queryindexfile"/>'+'&recId='+v_ctpnoticeopId+'&indexId='+encodeURI(noticeId.getValue())+'&labelId=noticeoption&businessType=0',
				            toolbar: proToolbarAnn,
				            toolbarPos: 'innertop',
				            footer: {
								auto:true                    
		                	}
				       });

					   
					                

                 queryGridlayout = new ctp.ui.gridlayout({
                     id: 'queryGridlayout',
                     width: '950px',
                     align: 'center',
                     defaults:{
             			align: 'center',
             			label: {width: '820px'},
            			element:{
            				//默认创建textfield组件
            				type: 'textfield',
            				//默认的组件自带属性,width设成'100%'或不传，则该组件和关联标签的宽度之和会占满所在的列
            				options:{width: '100%'}
            			}
                         			
             		 },
                                  
                     items: [
                               [{
                                label: {
                                    id: 'label1', 
                                    text: '<ctp:label key="title"/>', 
                                    width: '100px'
                                }, 
                                element: title,
                                colspan: 2
                        }],[{
                            label: {
                                id: 'label2', 
                                text: '<ctp:label key="time"/>', 
                                width: '100px'
                            }, 
                            element: time
                    },{
                        label: {
                            id: 'label6', 
                            text: '展现形式', 
                            width: '100px'
                        }, 
                        element: optiontype
                	}],[{
                                label: {
                                    id: 'label3', 
                                    text: '<ctp:label key="noticeId"/>', 
                                    width: '100px'
                                }, 
                                element: noticeId
                        }],[{
                            label: {
                                id: 'label4', 
                                text: '公告类型', 
                                width: '100px'
                            }, 
                            element: optype
                    }],[                               {
                        label: {
                            id: 'label5', 
                            text: '公告类型', 
                            width: '100px' 
                        }, 
                        element: asktype
                	}

                    ],[                               {
                            label: {
                                id: 'label7', 
                                text: '链&nbsp;&nbsp;接', 
                                width: '100px'
                            }, 
                            element: url,
                            colspan: 2
                    }],[                               {
                                label: {
                                    id: 'label9', 
                                    text: '<ctp:label key="content"/>', 
                                    width: '100px'
                                }, 
                                element: content,
                                colspan: 2
                        }],[{label: {
                            id: 'label13', 
                            text: '', 
                            width: '165px'
                        	},
                        	element: dataGridAnn,
                    		align: 'left',
                            colspan: 2
                    	}]                        
                	                	
                            ]
                 });

                queryGroupbox = new ctp.ui.groupbox({
                    id: 'queryGroupbox',
                    items: [
                        queryGridlayout
                    ]
                });
             
                queryForm = new ctp.form({
                    id: 'queryForm',
				    validator:formValidator,
				    width:'98%',
				    postType:'ajax',
				    fixValue:true,			        
				    ajaxPostParam:{success: formSucc} ,
                    items: [
                        queryGroupbox               
                    ],
                    buttons : [{
	                        id: 'submit',              
	                        text: '<ctp:label key="submit"/>',                  
	                        icon:'apply',
	                        onClick: submitForm 
                 		}, {                                 
	                       id: 'reset',             
	                       text: '<ctp:label key="reset"/>',                   
	                       icon:'reload',
	                       onClick:resetForm
                 	    }]	
                });


              //信息面板
              /*
                 sealrecordPanel = new ctp.ui.panel({
                    id: 'sealrecordPanel',
                    title: '<ctp:label key="detail.title"/>',
                    bodyPadding: 0,
                    style:'border',
                    toolbar:ctpToolbar,
    	           	toolbarPos:'innertop',
                    items: [
                        queryForm
                    ],
                    renderTo:'body'
                }); */	                
				
                queryPanel = new ctp.ui.panel({
                    id: 'queryPanel',
                    bodyPadding: 0,
                    collapsible:false,
                    items: [
                        queryForm
                    ]
                });

            
                borderlayout1 = new ctp.ui.borderlayout({
                    type: '1C',
                    center__size: 1.0,
                    center__items:[queryPanel],
                    renderTo: 'body'
                });
                //=========初始化页面数据===============================================
               initData();
              
            });
        </script>
    </head>
    <body>
        <ctp:form name="queryForm" method="post" action="ctpnoticeoptionmain.flowc" flowActionName="">
        	<input type="hidden" name="id" value='<ctp:out name="id"/>'/>
        	<input type="hidden" name="addUser" value='<ctp:out name="sessCtx.user.id"/>'/>
        	<input type="hidden" name="flag" value='<ctp:out name="flag"/>'/>
        	<input type="hidden" name="type" id="type" value=''/>
        	<input type="hidden" name="filePath" value=''/>
        	<input type="hidden" name="filename" id="filename" value=''/>
        </ctp:form>

        <ctp:form name="downloadForm" method="post" action="fileuploadnew.flowc" flowActionName="fileDownload">
			<input type="hidden" name="openType"  id="openType"/>
			<input type="hidden" name="fileName"  id="fileName"/>
			<input type="hidden" name="showFileName" id="showFileName"/>
        </ctp:form>
    </body>
    </body>
</html>
